<div class="album wp-20" ui-view="container">
    <div ng-if="!noPermission">
        <div class="head_title">
            <span class="jump-color" ui-sref="main.playPlan({pageNo:1,pageSize:10})">播控方案</span>
            <span class="jump-color" ui-sref="main.playPlan.playChannel({pageNo:1,pageSize:10})"> / 平台管理</span>
            <span class="tit-color"> / 渠道管理</span>
        </div>
        <div class="searchWapper white-background">
            <div class="form-group searchLump">
                <div class="searchTitle">操作：</div>
                <div class="search-select">
                    <button class="btn btn-primary" ng-click="new(clientType)" style="margin-left: 20px">新建</button>
                </div>
            </div>
        </div>

        <div class="white-background" style="margin:15px  0">

            <table class="table table-bordered table-hover table-page">
                <thead>
                <tr>
                    <th>渠道_ID</th>
                    <th>渠道名称</th>
                    <th>所属平台</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="channel in channels">
                    <td>
                        {{channel.id}}
                    </td>
                    <td>
                        {{channel.name}}
                    </td>
                    <td>
                        {{table[channel.clientType]}}
                    </td>
                    <td>
                        <a class="time-out" ng-click="edit(channel)">编辑</a>
                        <a  class="time-out" ng-if="channel.playPlanNum==0" ng-click="delete(channel)">删除</a>
                        <a  class="time-out not-circle" ng-if="channel.playPlanNum!=0" >删除</a>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>

        <div class="panel-footer paging">
            <s-pagination conf="paginationConf"></s-pagination>
        </div>

    </div>

    <div ng-if="noPermission" ng-include="'templates/no-permission.html'">

    </div>
</div>
<script type="text/ng-template" id="editChannel.html">
    <div class="modal-header">
        <button type="button" class="close" ng-click="cancel()"><span>&times;</span></button>
        <span class="modal-title">渠道编辑</span>
    </div>
    <form class="channel_box w5c-form demo-form newChannel"  w5c-form-validate name="newChannel">
        <ul>
            <li class="form-group">
                <span class="control-label" style="margin-left: -5px"><i class="red-icon">*</i>渠道名称：</span>
                <input type="text" placeholder="**公司" ng-model="name"
                       name="channelName2" required="" ng-minlength="2" ng-maxlength="50">
                <span ng-if="nameCheck" class="cl cr w5c-error" style="display: inline-block;">
                <i class="fa fa-times error" aria-hidden="true"></i>{{message}}
            </span>
            </li>
            <li>
                <span>所属平台：</span>
                <span>{{table[clientType]}}</span>

             <!--   <select class="personal-select select" ng-model="clientType"  ng-options="clientType.key as clientType.value for clientType in clientTypes" >
                </select>-->


            </li>
        </ul>

        <div class="bottom_foot">
            <span class="refer" w5c-form-submit="submit()" >提交</span>
            <span class="cancel" ng-click="cancel()" >取消</span>
        </div>
    </form>

</script>

<script type="text/ng-template" id="newChannel.html">
    <div class="modal-header">
        <button type="button" class="close" ng-click="cancel()"><span>&times;</span></button>
        <span class="modal-title">渠道添加</span>
    </div>
    <form class="channel_box w5c-form demo-form newChannel"  w5c-form-validate name="newChannel">
        <ul>
            <li class="form-group">
                <span class="control-label" style="margin-left: -5px"><i class="red-icon">*</i>渠道名称：</span>
                <input type="text" placeholder="渠道名称" ng-model="formData.name"
                       name="channelName" required="" ng-minlength="2" ng-maxlength="50">
                <span ng-if="nameCheck" class="cl cr w5c-error" style="display: inline-block;">
                    <i class="fa fa-times error" aria-hidden="true"></i>{{message}}
                </span>
            </li>
            <li>
                <span>所属平台：</span>
                <span ng-model="formData.clientType">{{table[platformId]}}</span>
              <!--  <select  ng-model="formData.clientType"  class="personal-select select" ng-init="formData.clientType='501'">
                    <option value="501">Ph_客户端_Android</option>
                    <option value="502">Ph_客户端_iOS</option>
                    <option value="503">Ph_网页</option>
                    <option value="504">Pad_Android</option>
                    <option value="505">Pad_iOS</option>
                    <option value="506">PC_网页</option>
                    <option value="507">PC_客户端</option>
                    <option value="508">TV_Android</option>
                    <option value="509">IVI_Android</option>
                </select>-->
            </li>
        </ul>
        <div class="bottom_foot">
            <span class="refer" w5c-form-submit="submit()" >提交</span>
            <span class="cancel" ng-click="cancel()" >取消</span>
        </div>
    </form>
    </div>